import { GET_ROUTES } from '@/store/public/CONST'
import { Commit } from 'vuex'
import { getRoutes } from '@/api/routes'

export default {
  async [GET_ROUTES] (context:{commit:Commit}) {
    const { data, meta } = await getRoutes()
    if (meta.status !== 200) return console.log('获取路由失败: ', meta)

    context.commit(GET_ROUTES, data)
  }
}
